<?php

namespace app\admin\controller;

use app\admin\controller\Base;
use app\common\model\FileLog;
use app\common\model\VisitShow;
use app\common\model\Copyright;
use think\facade\View;
use think\facade\Config;
use think\facade\Cache;


class Copyrights extends Base
{
   
    // 版权声明
    public function copyright()
    {
        // 查询顶级及其子类
        $get  = $this->request->get();
            $one =  Copyright::find(1);
            View::assign('one', $one);
            // var_dump($MaterialList);
            // die;
            return View::fetch();
     
    }

    // 修改版权声明
    public function savecopyright()
    {
      
        $post = $this->request->post();
        $Copyright = $post;

        try {
            Copyright::where(["id"=>1])->update($Copyright);
            return json(['code' => 1, 'msg' => '更新成功']);
        } catch (\Exception $e) {
            $msg = $e->getMessage();
            return json(['code' => 0, 'msg' => '新增失败']);
        }
         
    }
 
}
